Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(logging): impl Default for Logger, add timestamp to messages #170

Merged
merged 2 commits into from
Nov 12, 2023

Conversation

Jon-Becker
Copy link
Owner

Motivation

Previously, making a new logger looked like:

let level = std::env::var("RUST_LOG").unwrap_or_else(|_| "INFO".into());
let (logger, _) = Logger::new(&level);

Solution

You can now just do

let logger = Logger::default()

and the env + clap-verbosity will be taken into account when building the struct.

This PR also adds timestamps to the logs for debugging purposes (and it looks pretty)

@Jon-Becker Jon-Becker merged commit d2fb44f into main Nov 12, 2023
3 of 6 checks passed
@Jon-Becker Jon-Becker deleted the jon-becker/logger-overhaul branch January 1, 2024 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant